package cn.flaty.utils.web.file;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;


/**
 * 上传结果
 * @author flatychen
 * @date 2014-4-21
 */
public class UploadResult {
	
	/**
	 *  上传成功标志
	 */
	private boolean success;
	
	/**
	 *  上传消息
	 */
	private String message;
	
	/**
	 *  上传input表单名称
	 */
	private String uploadFormName;
	
	
	/**
	 *  文件上传时在表单中名字,包含扩展名
	 */
	private String realFileName;
	
	/**
	 *  文件引用地址
	 */
	private String webLinkfileName;
	

	/**
	 * 文件扩展名 
	 */
	private String fileExtName;
	
	
	public String getRealFileName() {
		return realFileName;
	}

	public void setRealFileName(String realFileName) {
		this.fileExtName = FilenameUtils.getExtension(realFileName);
		this.realFileName = realFileName;
	}



	public String getMessage() {
		if(this.success){
			this.message = "上传成功";
		}
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}




	public boolean getSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getUploadFormName() {
		return uploadFormName;
	}

	public void setUploadFormName(String uploadFormName) {
		this.uploadFormName = uploadFormName;
	}

	public String getWebLinkfileName() {
		return webLinkfileName;
	}

	public void setWebLinkfileName(String webLinkfileName) {
		this.webLinkfileName = webLinkfileName;
	}

	public String getFileExtName() {
		
		return fileExtName;
	}

	

}
